From 73e4aa4e2b844b0b53802348c0d26a7e7bda36c4 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Fri, 21 Oct 2005 16:22:09 +0100 Subject: [PATCH] Fix allocation of phys_to_machine_mapping array during x86/64 linux boot. The original builder-provided array must be made read-only in the initial mapping. Signed-off-by: Keir Fraser --- linux-2.6-xen-sparse/arch/xen/x86_64/kernel/e820.c | 2 +- linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/e820.c b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/e820.c index 6f9ab86b79..c4f0999d32 100644 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/e820.c +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/e820.c @@ -519,7 +519,7 @@ void __init setup_memory_region(void) e820_print_map(who); } -#else /* CONFIX_XEN */ +#else /* CONFIG_XEN */ extern unsigned long xen_override_max_pfn; extern union xen_start_info_union xen_start_info_union; diff --git a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c index 19f5e957a5..9c51a4f270 100644 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c @@ -733,6 +733,7 @@ void __init setup_arch(char **cmdline_p) #ifdef CONFIG_XEN { int i, j, k, fpp; + /* Make sure we have a large enough P->M table. */ phys_to_machine_mapping = alloc_bootmem( end_pfn * sizeof(unsigned long)); @@ -745,6 +746,9 @@ void __init setup_arch(char **cmdline_p) __pa(xen_start_info->mfn_list), PFN_PHYS(PFN_UP(xen_start_info->nr_pages * sizeof(unsigned long)))); + make_pages_readonly((void *)xen_start_info->mfn_list, + PFN_UP(xen_start_info->nr_pages * + sizeof(unsigned long))); /* * Initialise the list of the frames that specify the list of -- 2.30.2